var StandardAPI = function(apiRoot, token) {
  this.apiRoot = apiRoot;
  this.token = token;
}

StandardAPI.prototype.isFollowing = function(target) {
    _xhr = new XMLHttpRequest();
    _xhr.open("GET", this.apiRoot + '/subscribe?oauth_token=' + this.token + '&acct=' + target, false);
    _xhr.send(null);
    isSubscribedResponse = JSON.parse(_xhr.responseText);
    return isSubscribedResponse.isSubscribed;
}
      
StandardAPI.prototype.startFollowing = function(target) {
  var xhr = new XMLHttpRequest();
  xhr.open("POST", this.apiRoot + '/subscribe?oauth_token=' + this.token + '&acct=' + target, false);
  xhr.send(null);
  //handle the response at least.
}
      
StandardAPI.prototype.stopFollowing = function(target) {
  var xhr = new XMLHttpRequest();
  xhr.open("DELETE", this.apiRoot + '/subscribe?oauth_token=' + this.token + '&acct=' + target, false);
  xhr.send(null);
  //handle the response at least.      
}